/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.triumphsys.icici.cmeeting.portlet.model.impl;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.util.PortalUtil;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import com.triumphsys.icici.cmeeting.portlet.model.CMMeeting;
import com.triumphsys.icici.cmeeting.portlet.model.CMMeetingModel;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.Date;

/**
 * The base model implementation for the CMMeeting service. Represents a row in the &quot;CM_MEETING&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.triumphsys.icici.cmeeting.portlet.model.CMMeetingModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link CMMeetingImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a c m meeting model instance should use the {@link com.triumphsys.icici.cmeeting.portlet.model.CMMeeting} interface instead.
 * </p>
 *
 * @author Triumphsys
 * @see CMMeetingImpl
 * @see com.triumphsys.icici.cmeeting.portlet.model.CMMeeting
 * @see com.triumphsys.icici.cmeeting.portlet.model.CMMeetingModel
 * @generated
 */
public class CMMeetingModelImpl extends BaseModelImpl<CMMeeting>
	implements CMMeetingModel {
	public static final String TABLE_NAME = "CM_MEETING";
	public static final Object[][] TABLE_COLUMNS = {
			{ "meetingId", new Integer(Types.BIGINT) },
			{ "calEventId", new Integer(Types.BIGINT) },
			{ "groupId", new Integer(Types.BIGINT) },
			{ "companyId", new Integer(Types.BIGINT) },
			{ "userId", new Integer(Types.BIGINT) },
			{ "modifiedBy", new Integer(Types.BIGINT) },
			{ "createDate", new Integer(Types.TIMESTAMP) },
			{ "modifiedDate", new Integer(Types.TIMESTAMP) },
			{ "proposalFolderId", new Integer(Types.BIGINT) },
			{ "momsFolderId", new Integer(Types.TIMESTAMP) },
			{ "extractsFolderId", new Integer(Types.BIGINT) },
			{ "venue", new Integer(Types.VARCHAR) },
			{ "entityId", new Integer(Types.BIGINT) },
			{ "firstLockDate", new Integer(Types.TIMESTAMP) },
			{ "secondLockDate", new Integer(Types.TIMESTAMP) },
			{ "thiirdLockDate", new Integer(Types.TIMESTAMP) },
			{ "momLockDate", new Integer(Types.TIMESTAMP) }
		};
	public static final String TABLE_SQL_CREATE = "create table CM_MEETING (meetingId LONG not null primary key,calEventId LONG,groupId LONG,companyId LONG,userId LONG,modifiedBy LONG,createDate DATE null,modifiedDate DATE null,proposalFolderId LONG,momsFolderId DATE null,extractsFolderId LONG,venue VARCHAR(75) null,entityId LONG,firstLockDate DATE null,secondLockDate DATE null,thiirdLockDate DATE null,momLockDate DATE null)";
	public static final String TABLE_SQL_DROP = "drop table CM_MEETING";
	public static final String ORDER_BY_JPQL = " ORDER BY cmMeeting.meetingId ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CM_MEETING.meetingId ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.triumphsys.icici.cmeeting.portlet.model.CMMeeting"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.triumphsys.icici.cmeeting.portlet.model.CMMeeting"),
			true);
	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.triumphsys.icici.cmeeting.portlet.model.CMMeeting"));

	public CMMeetingModelImpl() {
	}

	public long getPrimaryKey() {
		return _meetingId;
	}

	public void setPrimaryKey(long pk) {
		setMeetingId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_meetingId);
	}

	public long getMeetingId() {
		return _meetingId;
	}

	public void setMeetingId(long meetingId) {
		_meetingId = meetingId;
	}

	public long getCalEventId() {
		return _calEventId;
	}

	public void setCalEventId(long calEventId) {
		_calEventId = calEventId;
	}

	public long getGroupId() {
		return _groupId;
	}

	public void setGroupId(long groupId) {
		_groupId = groupId;
	}

	public long getCompanyId() {
		return _companyId;
	}

	public void setCompanyId(long companyId) {
		_companyId = companyId;
	}

	public long getUserId() {
		return _userId;
	}

	public void setUserId(long userId) {
		_userId = userId;
	}

	public String getUserUuid() throws SystemException {
		return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
	}

	public void setUserUuid(String userUuid) {
		_userUuid = userUuid;
	}

	public long getModifiedBy() {
		return _modifiedBy;
	}

	public void setModifiedBy(long modifiedBy) {
		_modifiedBy = modifiedBy;
	}

	public Date getCreateDate() {
		return _createDate;
	}

	public void setCreateDate(Date createDate) {
		_createDate = createDate;
	}

	public Date getModifiedDate() {
		return _modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		_modifiedDate = modifiedDate;
	}

	public long getProposalFolderId() {
		return _proposalFolderId;
	}

	public void setProposalFolderId(long proposalFolderId) {
		_proposalFolderId = proposalFolderId;
	}

	public Date getMomsFolderId() {
		return _momsFolderId;
	}

	public void setMomsFolderId(Date momsFolderId) {
		_momsFolderId = momsFolderId;
	}

	public long getExtractsFolderId() {
		return _extractsFolderId;
	}

	public void setExtractsFolderId(long extractsFolderId) {
		_extractsFolderId = extractsFolderId;
	}

	public String getVenue() {
		if (_venue == null) {
			return StringPool.BLANK;
		}
		else {
			return _venue;
		}
	}

	public void setVenue(String venue) {
		_venue = venue;
	}

	public long getEntityId() {
		return _entityId;
	}

	public void setEntityId(long entityId) {
		_entityId = entityId;
	}

	public Date getFirstLockDate() {
		return _firstLockDate;
	}

	public void setFirstLockDate(Date firstLockDate) {
		_firstLockDate = firstLockDate;
	}

	public Date getSecondLockDate() {
		return _secondLockDate;
	}

	public void setSecondLockDate(Date secondLockDate) {
		_secondLockDate = secondLockDate;
	}

	public Date getThiirdLockDate() {
		return _thiirdLockDate;
	}

	public void setThiirdLockDate(Date thiirdLockDate) {
		_thiirdLockDate = thiirdLockDate;
	}

	public Date getMomLockDate() {
		return _momLockDate;
	}

	public void setMomLockDate(Date momLockDate) {
		_momLockDate = momLockDate;
	}

	public CMMeeting toEscapedModel() {
		if (isEscapedModel()) {
			return (CMMeeting)this;
		}
		else {
			return (CMMeeting)Proxy.newProxyInstance(CMMeeting.class.getClassLoader(),
				new Class[] { CMMeeting.class }, new AutoEscapeBeanHandler(this));
		}
	}

	public ExpandoBridge getExpandoBridge() {
		if (_expandoBridge == null) {
			_expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
					CMMeeting.class.getName(), getPrimaryKey());
		}

		return _expandoBridge;
	}

	public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
		getExpandoBridge().setAttributes(serviceContext);
	}

	public Object clone() {
		CMMeetingImpl cmMeetingImpl = new CMMeetingImpl();

		cmMeetingImpl.setMeetingId(getMeetingId());

		cmMeetingImpl.setCalEventId(getCalEventId());

		cmMeetingImpl.setGroupId(getGroupId());

		cmMeetingImpl.setCompanyId(getCompanyId());

		cmMeetingImpl.setUserId(getUserId());

		cmMeetingImpl.setModifiedBy(getModifiedBy());

		cmMeetingImpl.setCreateDate(getCreateDate());

		cmMeetingImpl.setModifiedDate(getModifiedDate());

		cmMeetingImpl.setProposalFolderId(getProposalFolderId());

		cmMeetingImpl.setMomsFolderId(getMomsFolderId());

		cmMeetingImpl.setExtractsFolderId(getExtractsFolderId());

		cmMeetingImpl.setVenue(getVenue());

		cmMeetingImpl.setEntityId(getEntityId());

		cmMeetingImpl.setFirstLockDate(getFirstLockDate());

		cmMeetingImpl.setSecondLockDate(getSecondLockDate());

		cmMeetingImpl.setThiirdLockDate(getThiirdLockDate());

		cmMeetingImpl.setMomLockDate(getMomLockDate());

		return cmMeetingImpl;
	}

	public int compareTo(CMMeeting cmMeeting) {
		int value = 0;

		if (getMeetingId() < cmMeeting.getMeetingId()) {
			value = -1;
		}
		else if (getMeetingId() > cmMeeting.getMeetingId()) {
			value = 1;
		}
		else {
			value = 0;
		}

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		CMMeeting cmMeeting = null;

		try {
			cmMeeting = (CMMeeting)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = cmMeeting.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(35);

		sb.append("{meetingId=");
		sb.append(getMeetingId());
		sb.append(", calEventId=");
		sb.append(getCalEventId());
		sb.append(", groupId=");
		sb.append(getGroupId());
		sb.append(", companyId=");
		sb.append(getCompanyId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", modifiedBy=");
		sb.append(getModifiedBy());
		sb.append(", createDate=");
		sb.append(getCreateDate());
		sb.append(", modifiedDate=");
		sb.append(getModifiedDate());
		sb.append(", proposalFolderId=");
		sb.append(getProposalFolderId());
		sb.append(", momsFolderId=");
		sb.append(getMomsFolderId());
		sb.append(", extractsFolderId=");
		sb.append(getExtractsFolderId());
		sb.append(", venue=");
		sb.append(getVenue());
		sb.append(", entityId=");
		sb.append(getEntityId());
		sb.append(", firstLockDate=");
		sb.append(getFirstLockDate());
		sb.append(", secondLockDate=");
		sb.append(getSecondLockDate());
		sb.append(", thiirdLockDate=");
		sb.append(getThiirdLockDate());
		sb.append(", momLockDate=");
		sb.append(getMomLockDate());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(55);

		sb.append("<model><model-name>");
		sb.append("com.triumphsys.icici.cmeeting.portlet.model.CMMeeting");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>meetingId</column-name><column-value><![CDATA[");
		sb.append(getMeetingId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>calEventId</column-name><column-value><![CDATA[");
		sb.append(getCalEventId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>groupId</column-name><column-value><![CDATA[");
		sb.append(getGroupId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>companyId</column-name><column-value><![CDATA[");
		sb.append(getCompanyId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>modifiedBy</column-name><column-value><![CDATA[");
		sb.append(getModifiedBy());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>createDate</column-name><column-value><![CDATA[");
		sb.append(getCreateDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
		sb.append(getModifiedDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>proposalFolderId</column-name><column-value><![CDATA[");
		sb.append(getProposalFolderId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>momsFolderId</column-name><column-value><![CDATA[");
		sb.append(getMomsFolderId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>extractsFolderId</column-name><column-value><![CDATA[");
		sb.append(getExtractsFolderId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>venue</column-name><column-value><![CDATA[");
		sb.append(getVenue());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>entityId</column-name><column-value><![CDATA[");
		sb.append(getEntityId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>firstLockDate</column-name><column-value><![CDATA[");
		sb.append(getFirstLockDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>secondLockDate</column-name><column-value><![CDATA[");
		sb.append(getSecondLockDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>thiirdLockDate</column-name><column-value><![CDATA[");
		sb.append(getThiirdLockDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>momLockDate</column-name><column-value><![CDATA[");
		sb.append(getMomLockDate());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _meetingId;
	private long _calEventId;
	private long _groupId;
	private long _companyId;
	private long _userId;
	private String _userUuid;
	private long _modifiedBy;
	private Date _createDate;
	private Date _modifiedDate;
	private long _proposalFolderId;
	private Date _momsFolderId;
	private long _extractsFolderId;
	private String _venue;
	private long _entityId;
	private Date _firstLockDate;
	private Date _secondLockDate;
	private Date _thiirdLockDate;
	private Date _momLockDate;
	private transient ExpandoBridge _expandoBridge;
}